package com.guoqi.oabridge.bridgeImpl

import com.alibaba.fastjson.JSONObject
import com.guoqi.oabridge.Callback
import com.tencent.smtt.sdk.WebView


/**
 * 屏幕
 * @author GUOQI
 */
open class ScreenImpl : IBridge {

    companion object {

        /**
         * 获取屏幕信息
         */
        @JvmStatic
        open fun getScreenInfo(webView: WebView, param: JSONObject, callback: Callback) {
            val dm = webView.context.resources.displayMetrics
            val obj = JSONObject()
            obj["height"] = dm.heightPixels
            obj["width"] = dm.widthPixels
            obj["density"] = dm.density
            callback.apply(Callback.setSuccess(obj))
        }

    }
}
